package com.t2t.top.create.$01factorymethod.standard.simple;

import com.t2t.top.create.$01factorymethod.standard.MailSender;
import com.t2t.top.create.$01factorymethod.standard.Sender;
import com.t2t.top.create.$01factorymethod.standard.SmsSender;

public class SendFactory {

    public Sender produce(String type) {
        if ("mail".equals(type)) {
            return new MailSender();
        }
        if ("sms".equals(type)) {
            return new SmsSender();
        }
        System.out.println("请输入正确的类型!");
        return null;
    }
}  